home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / tt / patch1 < prev   
Encoding:
Internet Message Format  |  1989-07-06  |  3.6 KB

  1. Path: uunet!zephyr!tektronix!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v06i082:  tt - Tetris for ordinary terminals, Patch1
  5. Message-ID: <4136@tekred.CNA.TEK.COM>
  6. Date: 24 Jun 89 00:19:56 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 80
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Mike Taylor <maujf@cu.warwick.ac.uk>
  12. Posting-number: Volume 6, Issue 82
  13. Archive-name: tt/Patch1
  14. Patch-To: Volume 6, Issue 81
  15.  
  16.     [I repackaged this as a context diff inside a shar file. Feed
  17.      directly to patch(1), or however you want to do it.  -br]
  18.  
  19.  
  20. Patch #1 for "tt" - Tetris for terminals
  21. ========================================
  22.  
  23. This is not a bug-fix as such, but a short piece of code to be
  24. appended to the header-file tt.h, which will allow tt to run on
  25. Berkeley UNIXes older than 4.3, (ie. those without the FD_ macros).
  26. These macros were introduced in 4.3 (and in SunOS 4.0) since these
  27. UNIXes allow more than 32 file-descriptors open at once, and thus they
  28. can no longer all be flagged by setting bits in a 32-bit long integer.
  29.  
  30. In fact, "tt" only select()s on one file-descriptor at a time, so the
  31. lack of width will certainly be no problem.  The macros as defined
  32. here simply twiddle the bits of a long integer in much the same way as
  33. I would have done in the first place had I written "tt" to run under
  34. 4.2, but using the same names as the corresponding 4.3 macros, so none
  35. of the existing "tt" code need be changed.
  36.  
  37. Sorry I didn't think of this before I posted the first time!
  38.  
  39. Have fun! -- Unkle Mirk
  40.  
  41. #! /bin/sh
  42. # This is a shell archive.  Remove anything before this line, then unpack
  43. # it by saving it into a file and typing "sh file".  To overwrite existing
  44. # files, type "sh file -c".  You can also feed this as standard input via
  45. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  46. # will see the following message at the end:
  47. #        "End of shell archive."
  48. # Contents:  patches01
  49. # Wrapped by billr@saab on Fri Jun 23 17:20:37 1989
  50. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  51. if test -f 'patches01' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'patches01'\"
  53. else
  54. echo shar: Extracting \"'patches01'\" \(1166 characters\)
  55. sed "s/^X//" >'patches01' <<'END_OF_FILE'
  56. X*** tt.h.orig    Wed Jun 21 06:46:22 1989
  57. X--- tt.h    Fri Jun 23 17:17:31 1989
  58. X***************
  59. X*** 133,135 ****
  60. X--- 133,154 ----
  61. X  extern void signal_die ();    /* When CTRL-C etc. is pressed */
  62. X  
  63. X  /*-------------------------------------------------------------------------*/
  64. X+ /***************************************************************************\
  65. X+ |*                                       *|
  66. X+ |*  The following macros will be defined if FD_ZERO is not defined by       *|
  67. X+ |*  the system.  They simulate the behaviour of 4.3bsd's FD_ macros for       *|
  68. X+ |*  4.2bsd machines, (ie. those running Berkeley UNIX, but of earlier       *|
  69. X+ |*  issue than 4.3; also SunOS, issues earlier than 4.0.           *|
  70. X+ |*                                       *|
  71. X+ |*  This section added Fri Jun 23 20:18:20 BST 1989               *|
  72. X+ |*  Written by Mike Taylor (mirk@uk.ac.warwick.cs)               *|
  73. X+ |*                                       *|
  74. X+ \***************************************************************************/
  75. X+ 
  76. X+ #ifndef FD_ZERO
  77. X+ #  define fd_set long int
  78. X+ #  define FD_ZERO(fds_ptr) *(fds_ptr) = 0
  79. X+ #  define FD_SET(fd, fds_ptr) *(fds_ptr) |= (1<<(fd))
  80. X+ #endif /* FD_ZERO */
  81. X+ 
  82. X+ /*-------------------------------------------------------------------------*/
  83. END_OF_FILE
  84. if test 1166 -ne `wc -c <'patches01'`; then
  85.     echo shar: \"'patches01'\" unpacked with wrong size!
  86. fi
  87. # end of 'patches01'
  88. fi
  89. echo shar: End of shell archive.
  90. exit 0
  91.